home *** CD-ROM | disk | FTP | other *** search
- function checkEmail(e)
- {
- function checkChars(s, i, l)
- {
- while(i < l && "_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".indexOf(s.charAt(i)) != -1)
- {
- i = i + 1;
- }
- return i;
- }
- function checkFirstLevelDomainChars(s, i, l)
- {
- while(i < l && "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(s.charAt(i)) != -1)
- {
- i = i + 1;
- }
- return i == l;
- }
- var _loc1_ = undefined;
- var _loc2_ = undefined;
- var _loc3_ = e.length;
- var _loc5_ = false;
- trace(e);
- if((_loc1_ = checkChars(e,0,_loc3_)) == 0)
- {
- return -1;
- }
- _loc2_ = _loc1_;
- while(_loc1_ < _loc3_ && e.charAt(_loc1_) == ".")
- {
- _loc1_ = _loc1_ + 1;
- if((_loc2_ = checkChars(e,_loc1_,_loc3_)) == _loc1_)
- {
- return -2;
- }
- _loc1_ = _loc2_;
- }
- if(e.charAt(_loc1_) != "@")
- {
- return -3;
- }
- while(true)
- {
- _loc1_ = _loc2_ + 1;
- _loc2_ = checkChars(e,_loc1_,_loc3_);
- if(_loc2_ == _loc1_)
- {
- break;
- }
- if(_loc2_ == e.length)
- {
- _loc2_ -= _loc1_;
- if(_loc5_ && _loc2_ >= 2 && checkFirstLevelDomainChars(e,_loc1_,_loc3_))
- {
- return 1;
- }
- return -5;
- }
- _loc5_ = e.charAt(_loc2_) == ".";
- if(!(_loc1_ < _loc3_ && _loc5_))
- {
- return -6;
- }
- }
- return -4;
- }
- this.swapDepths(16000);
- stop();
- closeMe = function()
- {
- gotoAndStop(1);
- };
- expandMe = function()
- {
- gotoAndStop(2);
- };
- sendMail = function()
- {
- if(checkEmail(user_email) < 0)
- {
- showAlert(2);
- return undefined;
- }
- showAlert(1);
- this.createEmptyMovieClip("empty",10000);
- this.success = "";
- empty.user_email = user_email;
- user_message = "Feedback for Sketchbook Samurai The Game: \n" add user_message;
- empty.user_message = user_message;
- loadVariables("http://www.sketchbooksamurai.com/thegame/feedbackmail.php",empty,"POST");
- empty.onEnterFrame = function()
- {
- if(this.success != "")
- {
- user_email = "";
- user_message = "";
- showAlert(10);
- delete this.onEnterFrame;
- }
- else
- {
- trace("notYet");
- }
- };
- };
- showAlert = function(page)
- {
- if(!page)
- {
- page = 2;
- }
- alert.gotoAndStop(page);
- };
-